import request from '@/utils/request'
let baseURL = '/portal-server/v1/api'

/**
 * 结算报告总列表
 */
export const getSettlementReportApi = (data) => {
	return request({
		url: `${baseURL}/settlementReport/getSettlementReport`,
		method: 'post',
		data: data
	})
};
/**
 * 结算报告-保存或审批
 */
export const saveOrAuditReportApi = (data) => {
	return request({
		url: `${baseURL}/settlementReport/saveOrAuditReport`,
		method: 'post',
		data: data
	})
};
/**
 * 结算报告-保存或审批详情
 */
export const saveOrAuditReportInfoApi = (id) => {
	return request({
		url: `${baseURL}/settlementReport/querySettlementReportBpm?id=${id}`,
		method: 'get',
	})
};
/**
 * 结算报告列表详情
 */
export const getSettlementReportDetailApi = (data) => {
	return request({
		url: `${baseURL}/settlementReport/getSettlementReportDetail`,
		method: 'post',
		data: data
	})
};
/**
 * 模块或报表名称下拉列表，reportId：结算报告总列表id，type：1是模块 2是报表
 */
 export const getModuleOrReportsApi = (data) => {
	return request({
		url: `${baseURL}/settlementReport/getModuleOrReports?reportId=${data.reportId}&type=${data.type}`,
		method: 'get',
	})
};

/**
 * 结算报告列表详情 -- 下载模板
 */
//  export const commonDownloadTemplateExcelApi = (confKey) => {
// 	return request({
// 		url: `${baseURL}/settlementReport/commonDownloadTemplateExcel?confKey=${confKey}`,
// 		method: 'get',
// 		// data: data,
//         // responseType: 'blob'
// 	})
// };

/**
 * 结算报告列表详情 -- 上传文件
 */
 export const commonImpTemplateExcelApi = (data) => {
	return request({
		url: `${baseURL}/settlementReport/commonImpTemplateExcel`,
		method: 'post',
		data: data,
        // responseType: 'blob'
	})
};

/**
 * 资金来源与占用情况(合生 | 珠江) 保存
 */
export const fundsSourceSaveApi = (data) => {
	return request({
		url: `${baseURL}/settlementReport/saveOrUpdateSourceOccupationFunds`,
		method: 'post',
		data: data
	})
};

/**
 * 资金来源与占用情况(合生 | 珠江) 详情
 */
export const fundsSourceInfoApi = (reportDetailId) => {
	return request({
		url: `${baseURL}/settlementReport/getSourceOccupationFund?reportDetailId=${reportDetailId}`,
		method: 'get',
	})
};

/**
 * 通用纯文本分析保存
 */
export const saveOrUpdateCommonSingleTextAnalysisApi = (data) => {
	return request({
		url: `${baseURL}/settlementReport/saveOrUpdateCommonSingleTextAnalysis`,
		method: 'post',
		data: data
	})
};

/**
 * 通用纯文本分析查询
 */
export const getCommonSingleTextAnalysisApi = (reportDetailId) => {
	return request({
		url: `${baseURL}/settlementReport/getCommonSingleTextAnalysis?reportDetailId=${reportDetailId}`,
		method: 'get',
	})
};

/**
 * 通用表格分析保存
 */
export const saveOrUpdateCommonDynamicTableDataApi = (data) => {
	return request({
		url: `${baseURL}/settlementReport/saveOrUpdateCommonDynamicTableData`,
		method: 'post',
		data: data
	})
};

/**
 * 通用表格分析查询
 */
export const getCommonDynamicTableDataApi = (reportDetailId) => {
	return request({
		url: `${baseURL}/settlementReport/getCommonDynamicTableData?reportDetailId=${reportDetailId}`,
		method: 'get',
	})
};